<?php
require_once('SQLiteManager.php');
$dataBase = openDB("../database/catalogo");
if (isset($_POST['url'])){
	$getArray = array();
	parse_str($_POST['url'],$getArray);
	if (isset($_POST['accion'])){
		foreach($getArray as $key=>$value){
			if ( $key == "item"){
				if ( $_POST['accion'] == "agregar")
					ejecutarQuery($dataBase,"UPDATE raquetas SET likes = likes+1 WHERE id_raqueta = '{$value}'");
				else
					ejecutarQuery($dataBase,"UPDATE raquetas SET likes = likes-1 WHERE id_raqueta = '{$value}'");
			}	
			
		}
	}
}
?>